<template>
  <header class="common-header">
    <!-- 顶部装饰条 -->
    <div class="header-top-decoration"></div>

    <!-- 主内容区域 -->
    <div class="header-content">
      <!-- 主标题 -->
      <h1 class="main-title">
        <span class="title-text">国家助农宣传专栏</span>
        <span class="title-decoration"></span>
      </h1>

      <!-- 导航栏 -->
      <nav class="navigation-bar">
        <el-button
            @click="$router.push('/support')"
            type="text"
            class="nav-btn"
            active-class="is-active"
        >
          <i class="el-icon-document"></i> 首页
        </el-button>
        <el-button
            @click="$router.push({ name: 'PolicyPage' })"
            type="text"
            class="nav-btn"
            active-class="is-active"
        >
          <i class="el-icon-document"></i> 惠农政策宣传
        </el-button>
        <el-button
            @click="$router.push({ name: 'ProductPage' })"
            type="text"
            class="nav-btn"
            active-class="is-active"
        >
          <i class="el-icon-goods"></i> 助农产品推荐
        </el-button>
        <el-button
            @click="$router.push({ name: 'StoryPage' })"
            type="text"
            class="nav-btn"
            active-class="is-active"
        >
          <i class="el-icon-video-camera"></i> 乡村振兴故事宣传
        </el-button>
      </nav>

      <!-- 面包屑导航 -->
      <el-breadcrumb
          separator="/"
          class="breadcrumb-nav"
      >
        <el-breadcrumb-item :to="{ path: '/support' }">
          <i class="el-icon-house"></i> 首页
        </el-breadcrumb-item>
        <el-breadcrumb-item>
          {{ pageTitle }}
        </el-breadcrumb-item>
      </el-breadcrumb>
    </div>
  </header>
</template>

<script setup>
import { defineProps } from 'vue'
defineProps({
  pageTitle: {
    type: String,
    required: true
  }
});
</script>

<style scoped>
.common-header {
  background: linear-gradient(135deg, #f0f7e9 0%, #e3f2fd 100%);
  border-bottom: 1px solid rgba(103, 194, 58, 0.1);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.header-top-decoration {
  height: 4px;
  background: linear-gradient(90deg, #4CAF50, #8BC34A, #4CAF50);
  width: 100%;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 30px;
}

.main-title {
  text-align: center;
  color: #2E7D32;
  font-size: 2.5rem;
  margin: 0 0 30px;
  letter-spacing: 2px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
  position: relative;
  padding-bottom: 15px;
  font-weight: 600;
}

.title-decoration {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.navigation-bar {
  display: flex;
  justify-content: center;
  margin: 20px 0;
  padding: 15px 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.nav-btn {
  margin: 0 25px;
  font-size: 16px;
  color: #555;
  font-weight: 500;
  position: relative;
  padding: 10px 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
}

.nav-btn i {
  margin-right: 8px;
  font-size: 18px;
  color: #4CAF50;
}

.nav-btn:hover {
  color: #4CAF50;
  transform: translateY(-2px);
}

.nav-btn.is-active {
  color: #4CAF50;
  font-weight: 600;
}

.nav-btn.is-active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 70%;
  height: 3px;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  border-radius: 2px;
}

.breadcrumb-nav {
  padding: 15px 0;
  font-size: 14px;
  color: #666;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 6px;
  display: inline-block;
  padding: 8px 15px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.breadcrumb-nav i {
  margin-right: 5px;
  color: #4CAF50;
}

.el-breadcrumb__item a {
  color: #4CAF50;
  text-decoration: none;
  transition: color 0.3s;
  font-weight: 500;
}

.el-breadcrumb__item a:hover {
  color: #8BC34A;
}

.el-breadcrumb__item:last-child span {
  color: #2E7D32;
  font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .header-content {
    padding: 15px;
  }

  .main-title {
    font-size: 2rem;
  }

  .navigation-bar {
    flex-wrap: wrap;
    padding: 10px;
  }

  .nav-btn {
    margin: 8px 15px;
    font-size: 14px;
  }

  .nav-btn i {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .main-title {
    font-size: 1.8rem;
  }

  .nav-btn {
    margin: 8px 10px;
    font-size: 13px;
  }
}
</style>